package oop第一章作业;
import java.util.Scanner;
public class Swith {
    Scanner input=new Scanner(System.in);
    int number1;
    int number2;
    int symbol;
    public void swith(){
        System.out.println("请输入第一个数");
        this.number1=input.nextInt();
        System.out.println("请输入第二个数");
        this.number2=input.nextInt();
        System.out.println("1.加2.减3.乘4.除");
        System.out.print("请选择");
        this.symbol=input.nextInt();
        switch (this.symbol){
            case 1:
                System.out.println(
                        number1+number2
                );
                break;
            case 2:
                System.out.println(
                        number1-number2
                );
                break;
            case 3:
                System.out.println(
                        number1*number2
                );
                break;
            case 4:
                System.out.println(
                        number1/number2
                );
                break;
        }
    }
}
